package com.homegoods.shoppingcar.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.homegoods.shoppingcar.item.GoodsItem;
import com.kedll.library.adapter.MultiTypeAdapter;
import com.kedll.library.mvp.BaseModel;

import java.math.BigDecimal;

/**
 * 商品类，本地用变量应该加上标志 ' _local '
 */
public class GoodsBean extends BaseModel<GoodsItem> {
    /**
     *
     * 	"sid": "8tNEC3WZeQLK00pqUA2orFAtNhGjLF4BmkHmq9rIh5D2fc6V7TW%2fpqrTBFSNQIeI",
     *      * 				"title": "Disney/迪士尼 魔术毯抱枕被子两用卡通盖毯毛毯绒毯子汽车折叠抱枕头空调毯披肩毯 魔术毯 100*150 ",
     *      * 				"img": "/upath/2019/1/14/17183547286037ufi.jpg",
     *      * 				"SChoice": "TREWTRE",
     *      * 				"AboutInf": "RETWTRETREWTREW",
     *      * 				"Money": "44",
     *      * 				"NCount": "3",
     *      * 				"SPSid": "nAnx0YQUyYNQ0SBU8DrWqjHTuMSi1L7y1AAdeXOHmdoHo7eCEHljsvA%2baYvigkV0"
     *
     */
    /**
     * 数量
     */
    @JSONField(alternateNames = {"comdiynum", "NCount"})
    private String number = "1";
    /**
     * 商品ID
     */
    @JSONField(alternateNames = {"sid"})
    private String goodsID;
    /**
     * 商品名称
     */
    @JSONField(alternateNames = {"comdiyname", "title"})
    private String goodsName;
    /**
     * 商品宣传图片
     */
    @JSONField(alternateNames = {"comdiyimg", "img"})
    private String goodsLogo;
    /**
     * 商品规格
     */
    @JSONField(alternateNames = {"comdiytxt"})
    private String pdtDesc;
    /**
     * 现价
     */
    @JSONField(alternateNames = {"currentprice", "Money"})
    private String price;

    private String SChoice;
    private String AboutInf;
    private String SPSid;

    private String PayCake;
    /**
     * 是否失效,0删除(失效),1正常
     */
    private String status;
    /**
     * 是否是编辑状态
     */
    private boolean isEditing;
    /**
     * 是否被选中
     */
    private boolean isChildSelected;

    /**
     * 是否是失效列表的子项
     */
    private boolean isInvalidItem;

    /**
     * 是否属于
     */
    private boolean isBelongInvalidList;

    private int groupPosition;

    private int childPosition;
    /**
     * 临时解决方案，为了避免尾部重绘两次，增加一个虚ITEM，不显示，但是没有子项的组项，会有一条黑线，所以需要做特殊处理
     */
    private boolean isLastTempItem;

    public int getGroupPosition() {
        return groupPosition;
    }

    public void setGroupPosition(int groupPosition) {
        this.groupPosition = groupPosition;
    }

    public int getChildPosition() {
        return childPosition;
    }

    public void setChildPosition(int childPosition) {
        this.childPosition = childPosition;
    }

    public boolean isLastTempItem() {
        return isLastTempItem;
    }

    public void setIsLastTempItem(boolean isLastTempItem) {
        this.isLastTempItem = isLastTempItem;
    }

    public boolean isBelongInvalidList() {
        return isBelongInvalidList;
    }

    public void setIsBelongInvalidList(boolean isBelongInvalidList) {
        this.isBelongInvalidList = isBelongInvalidList;
    }

    public boolean isInvalidItem() {
        return isInvalidItem;
    }

    public void setIsInvalidItem(boolean isInvalidItem) {
        this.isInvalidItem = isInvalidItem;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }


    public boolean isEditing() {
        return isEditing;
    }

    public void setIsEditing(boolean isEditing) {
        this.isEditing = isEditing;
    }

    public boolean isChildSelected() {
        return isChildSelected;
    }

    public void setIsChildSelected(boolean isChildSelected) {
        this.isChildSelected = isChildSelected;
    }

    public String getGoodsID() {
        return goodsID;
    }

    public void setGoodsID(String goodsID) {
        this.goodsID = goodsID;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public String getGoodsLogo() {
        return goodsLogo;
    }

    public void setGoodsLogo(String goodsLogo) {
        this.goodsLogo = goodsLogo;
    }

    public String getPdtDesc() {
        return pdtDesc;
    }

    public void setPdtDesc(String pdtDesc) {
        this.pdtDesc = pdtDesc;
    }

    public String getPayCake() {
        return PayCake;
    }

    public void setPayCake(String payCake) {
        PayCake = payCake;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getSChoice() {
        return SChoice;
    }

    public void setSChoice(String SChoice) {
        this.SChoice = SChoice;
    }

    public String getAboutInf() {
        return AboutInf;
    }

    public void setAboutInf(String aboutInf) {
        AboutInf = aboutInf;
    }

    public String getSPSid() {
        return SPSid;
    }

    public void setSPSid(String SPSid) {
        this.SPSid = SPSid;
    }

    @Override
    public GoodsItem createItem(MultiTypeAdapter adapter) {
        if (item == null) {
            item = new GoodsItem(this, adapter);
        }
        return item;
    }
}
